<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>

<body>
  <script>
    var i = 20
    var obj = {
      i: 1,
      fn: function () {
        setTimeout(() => {
          console.log(this);
          this.i++
        }, 0);
        console.log(this.i);
      }
    }
    // const print1 = obj.fn
    // print1()
    // print1()
    // const print2 = obj.fn
    // print2()
    obj.fn()
    obj.fn()
    setTimeout(() => {
      console.log(this.i);
    }, 0);
  </script>
</body>

</html>